<template>
    <div class="wrong-question-analysis">
        <HeaderBackBtn @back-btn="onBackBtn" />
        <div class="analysis-title">
            <div class="title">初级接警调度员</div>
            <div class="date">答案解析</div>
        </div>
        <div class="main">
            <el-scrollbar>
                <div class="question-list">
                    <div class="question-item" v-for="item in wrongQuestionList" :key="item.errorId">
                        <div class="question-title">{{ item.stashQuestionVo.quesTitle }}</div>
                        <div class="question-options">
                            <div class="option-item" v-for="optionItem in item.stashQuestionVo.answList">
                                <el-radio :label="optionItem.answSerial">
                                    {{ optionItem.answSerial }}.{{ optionItem.answContent }}</el-radio>
                            </div>
                        </div>
                    </div>
                </div>
            </el-scrollbar>
        </div>
    </div>
</template>

<script setup>
import HeaderBackBtn from '@/components/HeaderBackBtn'
import { getErrorAnswList } from '@/api/learn/wrong-question'

const wrongQuestionList = ref([])

function getWrongQuestionList() {
    getErrorAnswList().then(res => {
        wrongQuestionList.value = res.rows
    })
}
getWrongQuestionList()


const router = useRouter()
function onBackBtn() {
    router.push({ path: '/learn-center/wrong-question/index' })
}
</script>
<style scoped lang="scss">
.wrong-question-analysis {
    .analysis-title {
        padding-top: 16px;
        padding-bottom: 18px;
        border-bottom: 1px dotted #DDDDDD;

        .title {
            font-size: 24px;
            font-weight: bold;
            color: #2B5AA2;
            text-align: center;
            margin-bottom: 13px;
        }

        .date {
            font-size: 14px;
            color: #666666;
            text-align: center;
        }
    }
}
</style>